package com.gimi.cloud.jimi.merchantZone.common.springUtil;

import com.gimi.cloud.jimi.commonService.common.JmInitService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.dao.DataAccessException;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.stereotype.Component;


/**
 * 初始化配置
 * Created by shazhiwei on 2017/9/6.
 *
 */
@Component
public class InitConfig implements CommandLineRunner {

	private JmInitService jmInitService;

	private static Logger logger = LoggerFactory.getLogger(InitConfig.class);

	@Autowired
	public InitConfig(JmInitService jmInitService){
		this.jmInitService = jmInitService;
	}

	@Override
	public void run(String... arg0) throws Exception {
		jmInitService.initSysConfig();//初始化sys_config表
		jmInitService.initOssClient();//初始化oss客户端
	}

}
